﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using TrainingWorkshop.IDAL;
using TrainingWorkshop.DAL_EF.Translator;
using System.Data;

namespace TrainingWorkshop.DAL_EF
{
    public class TeacherRepository_EF:ITeacherRepository
    {
        /// <summary>
        /// get all teachers from table Teacher in database
        /// </summary>
        /// <returns>list of teacher</returns>
        public List<Model.Teacher> SelectAll()
        {
            
            List<Teacher> temp=new List<Teacher>();
            using(var db=new projectbEntities()){
             var   qurey = from t in db.Teachers
                            select t;

             temp= qurey.ToList();  
               
            }


            return TeacherTranslator.EFToModelTeacher(temp);
        }

    }
}
